package com.dcm.item.service;

import com.dcm.common.exception.MyException;
import com.dcm.item.entity.CategoryEntity;
import com.github.pagehelper.PageInfo;

import java.util.List;


/**
 * @author:zhouyuhan
 * 时间 2021/3/22 11:12
 */

public interface CategoryService {

    /**
     * 查询所有
     * @return
     */
    List<CategoryEntity> findAll();

    /**
     * 添加数据
     * @param tbCategory
     * @throws MyException
     * @return
     */
    void add(CategoryEntity tbCategory) throws MyException;

    /**


    /**
     * 修改整条数据
     * @param tbCategory
     * @throws MyException
     * @return
     */
    void update(CategoryEntity tbCategory) throws MyException;

    /**
     * 通过id删除
     * @param id
     * @throws MyException
     * @return
     */
    void delete(Long id) throws MyException;

    /**
     * 模糊姓名和状态
     * @param status
     * @param name
     * @return
     * @throws MyException
     */
    List<CategoryEntity> findByStatusAndName(Integer status, String name) throws MyException;

    /**
     * 添加子类
     * @param category
     * @throws MyException
     * @return
     */
    void addSecondCategory(CategoryEntity category) throws MyException;

    /**
     * 通过id修改状态
     * @param id
     * @param status
     * @throws MyException
     */
    void updateStatus(Long id, Integer status) throws MyException;

    /**
     * 分页
     * @param currentPage
     * @param pageSize
     * @return
     */
    PageInfo<CategoryEntity> findPage(Integer currentPage, Integer pageSize);
}
